/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       view.h
 * Author:     k.swiniarsk2
 * Created on: Sep 2, 2013
 *
 **********************************************************************************************************************/

#ifndef VIEW_H_
#define VIEW_H_

#include "dimmension.h"

namespace mGameEngine
{
namespace GUI
{

class View
{
protected:
	View *_parent;
    List<View *> _views;
	Dimmension _size;
	Dimmension _position;
	Dimmension _anchor;

public:
	View();
	virtual ~View();

    View *getRootView() const;

    View *getParentView() const
    {
        return _parent;
    }

    const List<View *> &getViews() const
    {
        return _views;
    }

    void addView(View *view, uint8 position = -1);

    void removeView(View *view);

    void removeAllViews();

	const Dimmension &getSize() const
	{
		return _size;
	}

	void setSize(const Dimmension &size)
	{
	    _size = size;
	}

	const Dimmension &getPosition() const
	{
	    return _position;
	}

	void setPosition(const Dimmension &position)
	{
	    _position = position;
	}

	const Dimmension &getAnchor() const
	{
	    return _anchor;
	}

	void setAnchor(const Dimmension &anchor)
	{
	    _anchor = anchor;
	}


	void draw() const;
};

}
}

#endif // VIEW_H_
